package com.linzm.behavioraltype.state08;

import com.linzm.behavioraltype.state08.state.StartState;
import com.linzm.behavioraltype.state08.state.StopState;

/**
 * @Author zimingl
 * @Date 2023/4/16 13:28
 * @Description: StatePatternDemo
 */
public class StatePatternDemo {
    public static void main(String[] args) {
        Context context = new Context();

        StartState startState = new StartState();
        startState.doAction(context);

        System.out.println(context.getState().toString());

        StopState stopState = new StopState();
        stopState.doAction(context);

        System.out.println(context.getState().toString());
    }
}
